package com.maimao.model.info;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 搜索记录
 *
 * @author MaoLin Wang
 * @date 2020/12/29 9:30 下午
 */
@Setter
@Getter
@NoArgsConstructor
@TableName("mm_search_history")
public class SearchHistory implements Serializable {

    private static final long serialVersionUID = -6810710969054702843L;

    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField("user_id")
    private Long userId;
    @TableField("`key`")
    private String key;
    @TableField("`create_time`")
    private LocalDateTime createTime;

    public SearchHistory(Long userId, String key, LocalDateTime createTime) {
        this.userId = userId;
        this.key = key;
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "SearchHistory{" +
                "id=" + id +
                ", userId=" + userId +
                ", key='" + key + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
